<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en" style="overflow-x: hidden">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-tap-highlight" content="no">

<link rel="stylesheet" href="<%=commonPath%>/pageRc/layui/css/layui.css"
	media="all">
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/utils.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/common/msgTool.js"></script>
<script type="text/javascript"
	src="<%=commonPath%>/pageRc/layui/layui.js"></script>
<title>待审核需求</title>

<script>
	$(function(){

 	})
	//注意：选项卡 依赖 element 模块，否则无法进行工能性操作
	layui.use('element', function() {
		var element = layui.element();

		//…
	});
</script>

</head>
<body>

	<table align="center"
		style="font-family: verdana, arial, sans-serif; font-size: 11px; color: #333333; border-width: 1px; border-color: #666666; border-collapse: collapse;">
		<tr>
			<th colspan="15"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">待审核需求</th>
		</tr>
		<tr>
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">需求编号</th>
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">需求名称</th>
				<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">所属项目组</th>
		
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">待审业务</th>
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">操作</th>
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">操作</th>
				<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">操作</th>
			<th colspan="2"
				style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede;">操作</th>
		</tr>
		<c:forEach items="${list}" var="need">
			<tr>
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;"><a href="javascript:void(0)" onclick="StageByupdate('${need.rouid}')"><u>${need.needNo}</u></a></td>
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;">${need.needName}</td>
								<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;">${need.proTeamName}</td>
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;">[需求审核]</td>
				<c:if test="${need.state =='00'}">
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;"><button onclick="pass('${need.rouid}',this)">需求通过</button></td>
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;"><button onclick="bohui('${need.rouid}',this)">需求驳回</button></td>
					</c:if>
			<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;"><button onclick="Stagepass('${need.rouid}',this)">需求计划通过</button></td>
				<td colspan="2"
					style="border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff;"><button onclick="Stagebohui('${need.rouid}',this)">需求计划驳回</button></td>
			</tr>
		</c:forEach>
	</table>

</body>
<script type="text/javascript">
var path="<%=commonPath%>";
var msg = new msgTool();
layui.use([ 'form', 'layer', 'laytpl', 'laypage', 'laydate' ],
		function() {
	var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
						var form = layui.form(), layer = layui.layer, laypage = layui.laypage, laytpl = layui.laytpl;
});

	function pass(rouid,obj){
		$.ajax({
			url:"../../page/need/updateStateByRouid.do",
			data:{"rouid":rouid,"state":"01"},
			type:"post",
			dataType:"json",
			success:function(data){
				layer.alert('通过成功!');
				$(obj).parent().parent().remove();
			}
		})
	}
	
	
	function bohui(rouid,obj){
		$.ajax({
			url:"../../page/need/updateStateByRouid.do",
			data:{"rouid":rouid,"state":"03"},
			type:"post",
			dataType:"json",
			success:function(data){
				layer.alert('驳回成功!');
				$(obj).parent().parent().remove();
			}
		})
	}
	
	
	function Stagepass(rouid,obj){
		$.ajax({
			url:"../../page/need/passNeedStageByRouid.do",
			data:{"rouid":rouid,"state":"01"},
			type:"post",
			dataType:"json",
			success:function(data){
				layer.alert('通过成功!');
				$(obj).parent().parent().remove();
			}
		})
	}
	
	
	function Stagebohui(rouid,obj){
		$.ajax({
			url:"../../page/need/updateNeedStageByRouid.do",
			data:{"rouid":rouid,"state":"01"},
			type:"post",
			dataType:"json",
			success:function(data){
				layer.alert('驳回成功!');
				$(obj).parent().parent().remove();
			}
		})
	}
	
	
	
	
	
	function StageByupdate(rouid) {
		layer.open({
			type : 2,
			title : "需求计划信息",
			area : [ '50%', '95%' ],
			scrollbar : false,
			content : '<%=commonPath%>/page/main/' + rouid+ '/StageByupdate.do',
			success : function(layero, index) {
			},
			end : function() {
			}
		});
	}
	
</script>
</html>